{{extend "blog_layout.html"}}

{{block content_main}}

{{use "jqutils",ajaxForm=True}}


<h1>{{=defined('title') or _('Edit')}}</h1>
<div>
<form class="ajax {{=defined('form_class') or 'form-horizontal'}}" 
    method="POST" 
    action="{{=defined('action') or request.url}}"
    id="edit_form">
{{build = form.build}}
{{<< build.body}}
{{<< build.buttons_line}}
</form>
</div>


<script>
$(function(){
    var el = $('#edit_form');
    
    $(el).submit(function(){
        var result_process = create_ajax_callback(function success(){
            window.location.href = '/blog/admin';
        });
    	
    	var options = { 
    		success: result_process,
    		dataType: 'json'
    	}; 
    
    	$(this).ajaxSubmit(options);
    
    	return false;
    });
});
</script>

{{end}}